<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>违法查询</title>
		<%include("/common/include.html"){}%>
		<link rel="stylesheet" href="${cxt!}/sb/plugins/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
		<!-- <script src="${cxt !}/sb/js/fineRegistration/fineQuery.js" type="text/javascript" charset="utf-8"></script> -->
		<style type="text/css">
		.textbox {
			padding-right: 0px;
			background: url("${cxt !}/sb/themes/insdep/images/combo_arrow.png")
				no-repeat scroll right center transparent;
		}
		</style>
	</head>
	<body class="easyui-layout">
			<div data-options="region:'north',split: true,title:'快速查询'" style="height:150px;padding:10px;">
				<form id="fineInfoStatisticFrom" action="">
					<!-- <div style="margin-bottom: 10px;float:left;margin-right: 10px;height:30px;line-height:30px;">
						<label class="label-top" style="width: 30px; display: block;float:left;">年月</label>
						<input id = "month" name="_query.month" value='${date(),dateFormat="yyyy"}' class="easyui-datebox theme-textbox-radius" style="width:120px;height:25px;float:right;"  
						data-options="editable: false,icons:[{
		                        iconCls:'icon-clear',
		                        handler: function(e){
		                            $(e.data.target).datetimespinner('clear');
		                        }
		                    }]"/>
		                   
					</div>
							<div style="margin-bottom: 10px;float:left;margin-right: 10px;height:30px;line-height:30px;">
						<label class="label-top" style="width: 30px; display: block;float:left;">日</label>
						
						<input id="day" name="_query.day" value='${day !}'  class="easyui-numberspinner inputBox theme-textbox-radius"  style="width:120px;height:25px;float:right;"  data-options="increment:1,min:1,max:31,icons:[{
		                        iconCls:'icon-clear',
		                        handler: function(e){
		                            $(e.data.target).datetimespinner('clear');
		                        }
		                    }]""/>
		                    
					</div> -->
					
					<!-- <div style="margin-bottom: 10px;float:left;margin-right: 10px;height:30px;line-height:30px;">
						<label class="label-top" style="width: 30px; display: block;float:left;">部门</label>
						<input class="easyui-combobox" style="width:120px;height:25px;"  id="DEPT" name="_query.DEPT"
							data-options="
							url:'departmentUser/getDept',
							method:'post',
							valueField:'ids',
							textField:'name'
							"> 
					</div> -->
					
					<div style="margin-bottom: 10px;float:left;margin-right: 10px;height:30px;line-height:30px;">
						<label class="label-top" style="width: 30px; display: block;float:left;">机构</label>
						<input class="easyui-combobox" style="width:120px;height:25px;"  id="ORGAN" name="_query.ORGAN"
							data-options="
							url:'organization/getORGAN',
							method:'post',
							valueField:'ids',
							textField:'name'
							"> 
					</div>
					
					<div style="margin-bottom: 10px;float:left;margin-right: 10px;height:30px;line-height:30px;">
						<label class="label-top" style="width: 50px; display: block;float:left;">开始时间</label>
						<input id="BEGINTIME" name="_query.BEGINTIME"
						class="easyui-datetimebox inputBox theme-textbox-radius date"
						style="border: 1px solid black; width: 160px; height: 25px;" />
					</div>
					
					<div style="margin-bottom: 10px;float:left;margin-right: 10px;height:30px;line-height:30px;">
						<label class="label-top" style="width: 50px; display: block;float:left;">结束时间</label>
						<input id="ENDTIME" name="_query.ENDTIME"
						class="easyui-datetimebox inputBox theme-textbox-radius date"
						style="border: 1px solid black; width: 160px; height: 25px;" />
					</div>
					
					<div style="margin-bottom: 10px;float:left;margin-right: 10px;height:30px;line-height:30px;">
						<label class="label-top" style="width: 50px; display: block;float:left;">违法代码</label>
						<input class="easyui-combobox" style="width:120px;height:25px;"  id="WFDM" name="_query.WFDM"
							data-options="
							url:'penalties/getPenalties',
							method:'post',
							valueField:'code',
							textField:'codecontent'
							">
					</div>
					
					<div style="margin-bottom: 10px;float:left;margin-right: 10px;height:30px;line-height:30px;">
						<label class="label-top" style="width: 50px; display: block;float:left;">车辆类型</label>
						<select id="CLLX" name="_query.CLLX" style="width: 120px;height:25px;">
							<option value="">--请选择--</option>
							<option value="电动自行车">电动自行车</option>
							<option value="电动二轮车">电动二轮车</option>
							<option value="电动轮椅车">电动轮椅车</option>
							<option value="电动三轮车">电动三轮车</option>
							<option value="小型低速电动汽车">小型低速电动汽车</option>
						</select>
					</div>
					
					</br></br></br>
					
					<div style="margin-bottom: 10px;float:left;margin-right: 10px;height:30px;line-height:30px;">
						<label class="label-top" style="width: 40px; display: block;float:left;">车牌号</label>
						<input class="easyui-combobox"  style="width:110px;height:25px;"  id="HPHM" name="_query.HPHM"    
							data-options="
							url:'commonUtil/getVehicleInfo',
							method:'post',
							valueField:'hphm',
							textField:'hphm'
							">
					</div>
					<div style="margin-bottom: 10px;float:left;margin-right: 10px;height:30px;line-height:30px;">
						<label class="label-top" style="width: 40px; display: block;float:left;">档案号</label>
							<input class="easyui-combobox" style="width:170px;height:25px;"  id="LSH" name="_query.LSH" 
							data-options="
							url:'commonUtil/getVehicleInfo',
							method:'post',
							valueField:'lsh',
							textField:'lsh'
							">
					</div>
					<div style="margin-bottom: 10px;float:left;margin-right: 10px;height:30px;line-height:30px;">
						<label class="label-top" style="width: 50px; display: block;float:left;">身份证号</label>
						<input class="easyui-combobox" style="width:160px;height:25px;"  id="SFZMHM" name="_query.SFZMHM" 
							data-options="
							url:'commonUtil/getVehicleInfo',
							method:'post',
							valueField:'sfzmhm',
							textField:'sfzmhm'
							">
					</div>
					
					<div style="margin-bottom: 10px;float:left;margin-right: 10px;height:30px;line-height:30px;">
						<label class="label-top" style="width: 50px; display: block;float:left;">缴纳状态</label>
						<select id="JNZT" name="_query.JNZT" style="width: 80px;height:25px;" >
							<option value="">--请选择--</option>
							<option value="已缴纳">已缴纳</option>
							<option value="未缴纳">未缴纳</option>
						</select>
					</div>
					<div>&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'"style="width:80px;height:25px;margin-top:5px"  onclick="searchFrom()">搜索</a>
						<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear'" style="width:80px;height:25px;margin-top:5px"  onclick="clearsj()">清除</a>
					</div>
					<input hidden="hidden" id="departmentids" value="${user.departmentids! }"></input>
					</form>
	   	 	</div>
	   	 	<div data-options="region:'center',border: false" style="overflow-x:hidden;"> 
				<table id="fineInfoTable" style="width:100%;height:100%;">
				</table>
	    	</div>
	    	
<script type="text/javascript">

var levelnum = "${organ.levelnum}";
var ids = "${organ.ids}";
$(document).ready(function () {
	
	if(levelnum == "3"){
		$("#ORGAN").combobox({'readonly': true});//设置下拉框为禁用 
		$("#ORGAN").combobox('setValue',ids);//菜单项可以text或者id
	}

	$("#LSH").combobox({
		onChange: function (n,o) {
			$("#HPHM").textbox("clear");
			$("#SFZMHM").textbox("clear");
			searchCus();
		}
	});
	$("#HPHM").combobox({
		onChange: function (n,o) {
			$("#LSH").textbox("clear");
			$("#SFZMHM").textbox("clear");
			searchCus();
		}
	});
	$("#SFZMHM").combobox({
		onChange: function (n,o) {
			$("#HPHM").textbox("clear");
			$("#LSH").textbox("clear");
			searchCus();
		}
	});

	var SFZMHM=$('#SFZMHM').val();
	var LSH=$('#LSH').val();
	var HPHM=$('#HPHM').val();
	
	if(SFZMHM==''&&LSH==''&&HPHM==''){
		return false;
	}
	searchCus();
});

//清空搜索条件
function clearsj(){
	if(levelnum != "3"){
		$("#ORGAN").textbox("clear");
	}
	
	$("#BEGINTIME").textbox("clear");
	$("#ENDTIME").textbox("clear");
	$("#WFDM").textbox("clear");
	$("#CLLX").val('');
	$("#HPHM").textbox("clear");
	$("#LSH").textbox("clear");
	$("#SFZMHM").textbox("clear");
	$("#JNZT").val('');
}


//获取违法信息
function searchCus(){
	var SFZMHM=$('#SFZMHM').val();
	var LSH=$('#LSH').val();
	var HPHM=$('#HPHM').val();
	
	if(SFZMHM==''&&LSH==''&&HPHM==''){
		return false;
	}
	var url='/fineRegistration/getVInfo';
	var data={"sfzmhm":SFZMHM,"lsh":LSH,"hphm":HPHM};
	var reData = common_ajax.ajaxFunc(url,data,"json");
	if(reData.msg==200){
		$("#SFZMHM").textbox('setValue',reData.vehicle.sfzmhm);
		$("#LSH").textbox('setValue',reData.vehicle.lsh);
		$("#HPHM").textbox('setValue',reData.vehicle.hphm);
		$("#CLLX").val(reData.vehicle.cllx);
		return  reData;
	}
}

//格式化日期
$.fn.datetimebox.defaults.formatter = function(date){
    //显示格式: 2017-05-08 17(只显示年月日)
    var year = date.getFullYear();
    var month = date.getMonth() + 1;
    var day = date.getDate();
    month = month < 10 ? '0' + month : month;
    day = day < 10 ? '0' + day : day;
    return year + "-" + month + "-" + day;
}

function myformatter2(date){
    var y = date.getFullYear();
    var m = date.getMonth()+1;
    var d = date.getDate();
    return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);
}
$(function () {
    var curr_time = new Date();
    $("#ENDTIME").datebox("setValue",myformatter2(curr_time));
})

   	var $form = $('#fineInfoStatisticFrom');
	function searchFrom(){
		initFineInfoTable();
	}
	var columns = [[
			  		{field:'vid',title:'vid',width:130,align:'center',hidden:true},
			  		{field:'ids',title:'ids',width:100,align:'center',hidden:true},
			  		{field:'hphm',title:'车牌号',width:80,align:'center'},
			  		{field:'cllx',title:'车辆类型',width:100,align:'center'},
			  		//{field:'lsh',title:'档案号',width:120,align:'center'},
			  		//{field:'sfzmhm',title:'身份证号',width:120,align:'center'},
			  		{field:'infractiondate',title:'违法时间',width:130,align:'center'},
			  		{field:'infractionplace',title:'违法地点',width:130,align:'center'},
			  		{field:'codecontent',title:'违法代码',width:200,align:'center'},
					{field:'punishment',title:'被处罚人',width:60,align:'center'},
					{field:'punishmentcontact',title:'联系方式',width:100,align:'center'},
					//{field:'pumoney',title:'罚款金额',width:50,align:'center'},
					//{field:'pumoneystatus',title:'缴纳状态',width:50,align:'center'},
					//{field:'qzcs',title:'行政强制措施',width:100,align:'center'},
					//{field:'sjwp',title:'收缴物品',width:100,align:'center'},
					//{field:'pudetails',title:'违法详情',width:150,align:'center'},
					//{field:'finepolice',title:'交通警察',width:60,align:'center'},
					//{field:'sdname',title:'部门',width:120,align:'center'},
					{field:'sdname',title:'机构',width:120,align:'center'},
					//{field:'creater',title:'创建人',width:50,align:'center'},
					//{field:'createdate',title:'创建时间',width:150,align:'center'},
					{field:'punote',title:'备注',width:200,align:'center'}
			      ]];
	function initFineInfoTable(){
		$('#fineInfoTable').datagrid({
			cls: "theme-datagrid",
			toolbar: '#tb',
			singleSelect: true,
			rownumbers: true, //显示序号
			pagination: true,
			pageSize: 10,
			url: "${cxt!}/fineQuery/querylist",
			queryParams: sy.serializeObject($form),
		    method: 'post',
			collapsible: true,
			remoteSort:false,
			multiSort:true,
			columns:columns,
			onLoadSuccess:function(){
				$('#fineInfoTable').datagrid("selectRow", 0);
				// 获取主表选中行
			},
			onClickRow:function(rowIndex,rowData){
			}
		});
	}
   </script>
<script type="text/javascript">


</script>
	</body>
</html>
